import React, { Component } from "react";

export default class Detail extends Component {
  //动态路由通过 props.match.params取得参数
  //id = this.props.match.params.id;

  //quert传参 通过props.location.query取参
  //id = this.props.location.query.id;

  //state传参 props通过location.state取参
  id = this.props.location.state.id;
  componentDidMount() {
    console.log(this.props);
  }
  render() {
    return <div>Detail---{this.id}</div>;
  }
}
